doctype
html
	head
		meta(charset="utf-8")
		title #{title}
		link(href="/css/admin.css",rel="stylesheet")
	body.sub-body
		.pos-rlt.p-md
			span 首页
			em >
			span 修改密码
		.p-md.m-top
			.panel.panel-default
				.panel-body
					.tab_t
						span.a.active 修改密码
				.pane-body.atricle-form
					.form-group.m-h-n.clearfix
						label.control-label 新密码：
						.col-sm-4
							input.form-control.password(type="password")
					.form-group.m-h-n.clearfix
						label.control-label 确认密码：
						.col-sm-4
							input.form-control.okpassword(type="password")
					.form-group.m-h-n.clearfix
						label.control-label
						.col-sm-6
							.submit_type.t-l
								button.btn.btn-sm.btn-danger#submit(type="submit") 提交

		script(src="http://cdn.bootcss.com/jquery/2.2.0/jquery.min.js",type="text/javascript")
		script(src="/js/adminBase.js",type="text/javascript")
		script.
			$(function () {
				$("#submit").on("click", function () {
					var password = $(".password").val();
					var okpassword = $(".okpassword").val();
					if ($.isEmptyObject(password)) {
						A.Msg("密码不能为空")
						return;
					} else if ($.isEmptyObject(okpassword)) {
						A.Msg("确认密码不能为空")
						return;
					} else if (password != okpassword) {
						A.Msg("两次输入的密码不一至")
						return;
					}
					$.ajax({
						url: '/admin/editPassword',
						type: 'POST',
						data: {
							password: password,
						},
						success: function (data) {
							if (data.success) {
								A.Msg(data.msg,function () {
									window.location.href="/admin/quit";
								})
							} else {
								A.Msg(data.msg)
							}
						}
					});
				})
			})
